<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>医生管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/phy/tDoctor/">医生列表</a></li>
		<li class="active"><a href="${ctx}/phy/tDoctor/form?id=${tDoctor.id}">医生<shiro:hasPermission name="phy:tDoctor:edit">${not empty tDoctor.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="phy:tDoctor:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="tDoctor" action="${ctx}/phy/tDoctor/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
		<c:if test="${empty admin.tenantId}" >
			<div class="control-group" >
				<label class="control-label">所属机构:</label>
				<div class="controls">
					<sys:treeselect id="tenant" name="tenantId" value="${tDoctor.tenantId}" labelName="tenantName" labelValue="${tDoctor.tenant.tenantName}"
									title="租户" url="/tenant/tTenant/treeData" cssClass="required" notAllowSelectParent="true"/>
					<span class="help-inline"><font color="red">*</font> </span>
				</div>
			</div>
		</c:if>
		<c:if test="${not empty admin.tenantId}">
			<form:hidden path="tenantId" value="${admin.tenantId}"></form:hidden>
		</c:if>
		<div class="control-group">
			<label class="control-label">诊室选择:</label>
			<div class="controls">
				<sys:treeselect id="office" name="officeId" value="${tDoctor.officeId}" labelName="officeName" labelValue="${tDoctor.office.officeName}"
								title="诊室" url="/phy/tOffice/treeData" cssClass="required" notAllowSelectParent="true"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group" >
			<label class="control-label">职称级别:</label>
			<div class="controls">
				<sys:treeselect id="rankId" name="rankId" value="${tDoctor.rankId}" labelName="rankName" labelValue="${tDoctor.tRank.rankName}"
								title="职称" url="/phy/tRank/treeData" cssClass="required" notAllowSelectParent="true"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
<%--		<div class="control-group" >--%>
<%--			<label class="control-label">专家级别:</label>--%>
<%--			<div class="controls">--%>
<%--				<sys:treeselect id="proRankId" name="proRankId" value="${tDoctor.proRankId}" labelName="rankName" labelValue="${tDoctor.tProRank.rankName}"--%>
<%--								title="专家级别" url="/phy/tProRank/treeData" cssClass="required" notAllowSelectParent="true"/>--%>
<%--				<span class="help-inline"><font color="red">*</font> </span>--%>
<%--			</div>--%>
<%--		</div>--%>
		<div class="control-group">
			<label class="control-label">医生姓名：</label>
			<div class="controls">
				<form:input path="doctorName" htmlEscape="false" maxlength="32" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否是专家：</label>
			<div class="controls">
				<form:radiobuttons path="proStatus" items="${fns:getDictList('shi_for')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">性别：</label>
			<div class="controls">
				<form:radiobuttons path="gender" items="${fns:getDictList('sex')}" value="" itemLabel="label" itemValue="value" htmlEscape="false" class="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系电话：</label>
			<div class="controls">
				<form:input path="mobile" htmlEscape="false" maxlength="32" class="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">头像：</label>
			<div class="controls">
				<form:hidden path="pic" />
				<sys:selectFile input="pic" type="thumb" uploadNum="1" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">隶属医院：</label>
			<div class="controls">
<%--				<form:checkboxes path="tenantIdsArr" items="${tenantList}" element="br" itemLabel="tenantName" itemValue="id" htmlEscape="false" class="required"/>--%>
				<form:input path="tenantIds" htmlEscape="false" maxlength="152" class="input-xlarge"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">医生擅长：</label>
			<div class="controls">
				<form:textarea path="doctorPerfer" htmlEscape="false" rows="4" maxlength="512" class="input-xxlarge required"/>
<%--				<sys:ckeditor replace="doctorPerfer" uploadPath="/cms/article" height="200px"/>--%>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">医生简介：</label>
			<div class="controls">
				<form:textarea path="desc" htmlEscape="false" rows="4" maxlength="512" class="input-xxlarge required"/>
<%--				<sys:ckeditor replace="desc" uploadPath="/cms/article" height="200px" />--%>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">线上咨询开关：</label>
			<div class="controls">
				<form:radiobuttons path="onlineStatus" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否开通预约挂号：</label>
			<div class="controls">
				<form:radiobuttons path="bookStatus" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否离职：</label>
			<div class="controls">
				<form:radiobuttons path="dimission" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注信息：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="phy:tDoctor:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>
